SELECT max(t.id) FROM C1_SITE T WHERE ( Sysdate BETWEEN t.begin_date AND t.end_date ) AND t.code = :code